package cn.ift8.spring.aop;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.testng.annotations.Test;

/**
 * Created by IFT8
 * on 2015/8/18.
 */
public class LoginTest {

    @Test
    public void test() {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("cn/ift8/spring/aop/aop.xml");
        //权限赋值
        Privilege privilege = (Privilege) applicationContext.getBean("privilege");
        privilege.setAccess("pass");
        //执行代理对象方法
        LoginManage loginManage = (LoginManage) applicationContext.getBean("loginManage");
        loginManage.showState();
    }
}
